﻿

class CubigrafConnector extends Connector {

	private var middleFrame:Number = 30;
	private var endStartFrame:Number = 80;
	
	function CubigrafConnector() {
		super();
		setAnimationHandlers(startAnimation, stopAnimation);
		//TODO use debug value here
		setShowErrors(true);
	}

	private function startAnimation() {
		gotoAndPlay(2);
	}
	
	private function stopAnimation() {
		var shift = 0;
		if(_currentframe <= middleFrame) {
			shift = middleFrame - _currentframe;
		}
		else {
			shift = _currentframe - middleFrame;
		}
		gotoAndPlay(endStartFrame + shift);
	}
	
}